﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WPF各种控件样式.WPFStyle
{
    /// <summary>
    /// 内敛样式
    /// </summary>
    public partial class InlineStyle : Window
    {
        public InlineStyle()
        {
            InitializeComponent();
            btn_Cancel.Click += new RoutedEventHandler(btn_Cancel_Click);
        }
        int cont = 0;
        void btn_Cancel_Click(object sender, RoutedEventArgs e)
        {
            //编程控制样式
            cont++;
            if (cont % 2 == 0)
                btn_Cancel.Style = (Style)FindResource("styleButton");
            else
                btn_Cancel.Style = new Style();// (Style)FindResource("styleButton");
        }
    }
}
